Cousin of the DynamicTable widget. Both return their result as an XML list document. The ListEditor allows editing of lists where only a limited number of the editable fields are displayed in the list. Columns and fields are displayed in the order that they are specified in the meta-data.
Event log:
| onError |
fires on error (when m_bDebug = true in HTC, shows alert as well)
event object propertieswindow.event.error String. Returns error detail. |
| onChange |
fires after user clicks 'Done' or 'Delete' buttons.
event object propertieswindow.event.XMLlist XMLNode. XML document node containing the list. Each
row is in a child <record> node containing a sub-node for each field/column.
Each <record> node is marked by a state attribute with one of four values:
"" = unchanged, "new", "changed", or "deleted".
Select columns return as two sub-nodes; one with the name of the column that contains the
underlying value, and one named columnId_displayvalue containing the display
name for that value. (this test page simply displays the event.XMLlist.xml in an alert)
|
| onNew |
fires when user clicks 'New' button and edit control fields have been cleared.
event object propertieswindow.event.recordNumber Positive integer. Returns -1 to indicate record is being added (always last record). window.event.XMLrecord XMLNode. The XML <record> node for the new row (empty) |
| onEdit |
fires when user clicks on a row to edit it and fields have been set in edit controls.
event object propertieswindow.event.recordNumber Positive integer. Returns number of record to edit. window.event.XMLrecord XMLNode. The XML <record> node for the row being edited |
| onCancel |
fires when user clicks 'Cancel' button.
event object propertiesnone |
| onValid |
fires when a user starts to edit a row and when they complete editing a row
event object propertieswindow.event.valid Boolean. Returns false if fired because user started to edit a row, false when Cancel or Accept is clicked |
| set elEditField = elListEditor.field(sFieldId) |
Gets the sub-control field element (HTML element with HTC attached)
parameterssFieldId Required. ID of field (column/field name in recordset). return valueHTMLElement. Returns the sub-control element for the field if sFieldId is a valid field in the elListEditor, null otherwise remarksOnce you have used this method to get a field control element you can use any of the methods and properties available to an EditField control. Please see the EditField reference for details. |
| DataXML |
xml data (from a recordset) data-island id. Usually in the format:
<document> <record> <fieldId1>fieldValue1</fieldId1> <fieldId2>fieldValue2</fieldId2> ... </record> ... </document> |
| MetaXML | xml meta-data data-island id |
| bValue = elListEditor.dirty |
| Read-only. Returns true if a row has been added, removed or edited, false otherwise. |
| set xmlList = elListEditor.XMLlist |
| Read-only. XML document node containing the list. Each row is in a child <record> node containing a sub-node for each field/column. Each record is marked by a state attribute with one of four values: "" = unchanged, "new", "changed", or "deleted". Select columns return two sub-nodes; one with the name of the column containing the underlying value and one named columnId_displayvalue containing the display name for that value. |
<XML ID='metaid'>
<listeditor>
<columns>
<column id='dept_name' width='50'>Name</column>
<column id='dept_desc' hide='yes'></column>
<column id='tag_number' width='25'>Tag</column>
<column id='percent_off' hide='yes'></column>
<column id='list_price' width='25'>Price</column>
<column id='start_date' hide='yes'></column>
<column id='start_time' hide='yes'></column>
<column id='dept_id' hide='yes'></column>
</columns>
<fields>
<text id='foo' hide='yes' maxlen='50' subtype='short'>
<name>Hidden control</name>
<tooltip>Hidden control tooltip</tooltip>
<error></error>
</text>
<text id='dept_name' required='yes' readonly='yes' maxlen='50' subtype='short'>
<name>Department Name</name>
<tooltip>department name tooltip</tooltip>
<error></error>
</text>
<text id='dept_desc' maxlen='2000' subtype='long'>
<name>Department Description</name>
<tooltip>department description tooltip</tooltip>
<error></error>
</text>
<numeric id='tag_number'min='5' max='100' subtype='integer'>
<name>Tag Number</name>
<tooltip>tag number tooltip</tooltip>
<error></error>
</numeric>
<numeric id='percent_off' min='0' max='100' subtype='float'>
<name>Percent Off</name>
<tooltip>percent off tooltip</tooltip>
<error></error>
</numeric>
<numeric id='list_price' required='yes'min='1' max='999' subtype='currency'>
<name>List Price</name>
<tooltip>list price tooltip</tooltip>
<error></error>
</numeric>
<date id='start_date' min='1/1/98' max='1/1/1'>
<name>Start Date</name>
<tooltip>start date tooltip</tooltip>
<error></error>
</date>
<select id='dept_id'>
<name>Department</name>
<tooltip>department tooltip</tooltip>
<select id='dept_id'>
<option value='1'>department 1</option>
<option value='2'>department 2</option>
<option value='3'>department 3</option>
<option value='4'>department 4</option>
<option value='5'>department 5</option>
</select>
</select>
</fields>
</listeditor>
</XML>